<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/20
  Time: 9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>登录界面</h1>

<h3> <a href="${pageContext.request.contextPath}/regist.jsp">注册</a>   </h3>
<p style="text-align: center;color: red">${error}</p>
<form action="${pageContext.request.contextPath}/login" method="post">

    <table border="1" cellspacing="0" cellpadding="10" align="center">

        <tr>
            <td>用户名</td>
            <td> <input type="text" name="username" value="${param.username}"/></td>
        </tr>

        <tr>
            <td>密码</td>
            <td><input type="password" name="password" /></td>
        </tr>


        <tr>
            <td>验证码</td>
            <td><input type="text" name="yan" />
                <img src="${pageContext.request.contextPath}/yanzheng" onclick="huan(this)">
            </td>
        </tr>


        <tr>
            <td colspan="2" align="center"><input type="submit" value="登录"/></td>
        </tr>
    </table>
    <p>账号：jingengao，密码是：123</p>

</form>


</body>

<script>

    function huan(obj) {
        obj.src = "${pageContext.request.contextPath}/yanzheng?shijian="+new Date().getTime();
    }
</script>
</html>
